﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Maticsoft.DBUtility;

public partial class UserControls_blockothersseconds : BaseUserControl 
{
    // Fields
    protected int i = 1;
    protected List<Maticsoft.Model.Team> otherteams = new List<Maticsoft.Model.Team>();

    // Methods
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
    }

    public void UpdateView(int teamid)
    {
        int sideteam = 0;
        if (base.ASSystem != null)
        {
            sideteam = base.ASSystem.Sideteam;
            if (sideteam != 0)
            {
                string str = " 1=1  ";
                str = string.Concat(new object[] { str, " and Team_type='seconds' and id<>", teamid, " and Begin_time<='", DateTime.Now.ToString(), "' and end_time>='", DateTime.Now.ToString(), "' and((Max_number>0 and Now_number<Max_number) or(Max_number=0))" });
                DataTable dt = DbHelperSQL.SelectByFilter("*", "", "", string.Concat(new object[] { "(select top ", sideteam, " * from team where ", str, " order by  sort_order desc,id asc ) as t1" }));
                this.otherteams = new Maticsoft.BLL.Team().DataTableToList(dt);
            }
        }
    }

}